
load('summary_data/figA15_A16.rda')

pal = c('blue',
        'deepskyblue',
        'darkslateblue',
        'chocolate1',
        'brown1',
        'darkred')

grDevices::cairo_pdf('figures/figA16.pdf', width = 7, height = 4)

ggplot(out16, aes(x = nat_quant, color = class, group = class, label = substr(group,1,1))) +
  geom_text(aes(y = f, size = if_else(group == 'White', 3, 2.5)), position = position_dodge(width = 0.75), alpha = 1)+
  theme_light() +
  scale_size_continuous(range=2:3) +
  scale_y_continuous(labels=scales::label_percent(), limits = c(0.0,.55),breaks = c(seq(0,.5,.1))) +
  labs(x = 'National Wealth Bin', y = '% Donor Retention', color = element_blank()) +
  scale_color_manual(values = pal[c(2,5,3,6)]) +
  theme(
    legend.position = 'bottom',
    axis.text.x = element_text(angle = 0, vjust = .85, hjust=0.5, size = 10),
    legend.margin = margin(0, 0, 0, 0),
    legend.spacing.x = unit(0, "mm"),
    legend.spacing.y = unit(0, "mm")
    ) +
  guides(color = guide_legend(nrow = 1, byrow = TRUE), size = 'none')

dev.off()
